<!--设置专业班教室-->
<template>
  <div class="wrapper-container">
    <div class="search-container">
      <InputItem
        :name="'级次'"
        :value="grade"
        @input="
          (e) => {
            grade = e;
          }
        "
      ></InputItem>
      <InputItem
        :name="'专业班次'"
        :value="className"
        @input="
          (e) => {
            className = e;
          }
        "
      ></InputItem>
      <SelectItem
        :name="'能否作为该专业班考场'"
        :value="yesOrNot"
        @change="
          (e) => {
            yesOrNot = e;
          }
        "
        :xqList="list"
      ></SelectItem>

      <div class="search-button">
        <img src="../../../assets/assessment/icon-search.png" alt="" />
        <span>查询</span>
      </div>
    </div>
    <div class="table-container">
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        class="table-data"
        row-class-name="row-class"
        cell-class-name="cell-class"
        header-row-class-name="header-row-class"
        header-cell-class-name="header-cell-class"
      >
        <el-table-column prop="grade" label="级次" width="156" align="center">
        </el-table-column>
        <el-table-column prop="className" label="专业班" align="center">
        </el-table-column>
        <el-table-column prop="address" label="专业班教室" align="center">
          <template slot-scope="scope">
            <div style="width: 100%; display: flex;justify-content: center;">
              <ButtonItem
                :name="'选择'"
                :link="''"
                :buttonColor="'deepblue'"
                @click="handleSelect(scope.$index, scope.row)"
              ></ButtonItem>
            </div>
          </template>
        </el-table-column>
        <el-table-column
          prop="courseTime"
          label="能否作为该专业班考场"
          align="center"
        >
          <SelectItem
            :name="''"
            :value="yesOrNot"
            @change="
              (e) => {
                yesOrNot = e;
              }
            "
            :xqList="list"
          ></SelectItem>
        </el-table-column>
      </el-table>
    </div>

    <el-dialog
      title="设置专业班教室"
      :visible.sync="showManualEntryDialog"
      width="1185px"
      class="manual-entry-container"
    >
      <div class="search-container">
        <InputItem
          :name="'场所名称'"
          :value="address"
          @input="
            (e) => {
              address = e;
            }
          "
        ></InputItem>

        <div class="search-button">
          <img src="../../../assets/assessment/icon-search.png" alt="" />
          <span>查询</span>
        </div>
      </div>

      <div class="table-container">
        <el-table
          :data="tableData2"
          border
          style="width: 100%"
          class="table-data"
          row-class-name="row-class"
          cell-class-name="cell-class"
          header-row-class-name="header-row-class"
          header-cell-class-name="header-cell-class"
        >
          <el-table-column prop="choice" label="选择" align="center">
            <template slot-scope="scope">
              <div style="width: 100%; display: flex;justify-content: center;">
                <!-- @change="handleSelect(scope.$index, scope.row)" -->
                <el-checkbox @change=""></el-checkbox>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="siteName" label="场地名称" align="center">
          </el-table-column>
          <el-table-column prop="galleryful" label="容纳人数" align="center">
          </el-table-column>
          <el-table-column
            prop="numberOfTestPlaces"
            label="考位数"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="classroomSituation"
            label="专业班级使用情况"
            align="center"
          >
          </el-table-column>
        </el-table>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import SelectItem from "../../../components/SelectItem.vue";
import InputItem from "../../../components/InputItem.vue";
import ButtonItem from "../../../components/ButtonItem.vue";
export default {
  components: {
    SelectItem,
    InputItem,
    ButtonItem,
  },
  data() {
    return {
      address: "",
      showManualEntryDialog: false,
      yesOrNot: "是",
      list: [
        {
          value: "是",
          label: "是",
        },
        {
          value: "否",
          label: "否",
        },
      ],
      grade: "",
      className: "",
      tableData: [
        {
          grade: "一年级",
          className: "1楼102",
        },
        {
          grade: "一年级",
          className: "1楼102",
        },
        {
          grade: "一年级",
          className: "1楼102",
        },
      ],
      tableData2: [
        {
          siteName: "一楼102",
          galleryful: "100",
          numberOfTestPlaces: "203",
          classroomSituation: "正常",
        },
        {
          siteName: "一楼102",
          galleryful: "100",
          numberOfTestPlaces: "203",
          classroomSituation: "正常",
        },
        {
          siteName: "一楼102",
          galleryful: "100",
          numberOfTestPlaces: "203",
          classroomSituation: "正常",
        },
      ],
    };
  },
  methods: {
    handleSelect(index, row) {
      this.showManualEntryDialog = true;
    },
  },
};
</script>
<style lang="less" scoped>
.search-container {
  justify-content: flex-start !important;
}

.search-button {
  cursor: pointer;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 27px;
  background: #f1f8fe;
  border: 1px solid #51aef6;
  border-radius: 6px;

  > span {
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #51aef6;
  }

  > img {
    width: 19px;
    height: 19px;
    margin-right: 4px;
  }
}

.table-container {
  margin-top: 30px;

  .el-table td,
  .el-table th.is-leaf,
  .el-table--border,
  .el-table--group {
    border-color: #c7d7eb;
  }

  .el-table__header tr,
  .el-table__header th {
    padding: 0;
    height: 76px;
    background-color: #edf2f9;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    line-height: 20px;
    color: #004ca7;
  }

  .el-table__body tr,
  .el-table__body td {
    padding: 0;
    height: 86px;
  }

  .wrapper-button {
    display: flex;
    flex-direction: column;
    align-items: center;

    > div {
      margin-bottom: 8px;
    }
  }
}
</style>

<style lang="less" scoped>
@import "../../../styles/special.less";

.manual-entry-container::v-deep .el-dialog__body {
  padding: 0px 200px 30px !important;
}
.manual-entry-container {
  .el-dialog__footer {
    padding-bottom: 43px;
  }
}
.wrapper-container {
  width: 1711px;
  margin: 0 auto;
}
.table-container {
  margin-top: 30px;

  .table-data {
    width: 100%;
    border: 0.8px solid #004ca7;
    border-radius: 9px;
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #004ca7;
  }
}

.save-button {
  width: 87px;
  height: 36px;
  line-height: 36px;
  background: #fff6ef;
  border: 1px solid #f3b815;
  border-radius: 6px;
  font-size: 18px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #f3b815;
  text-align: center;
  margin: 82px auto;
}

.zuoyou {
  width: 200px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
</style>
